<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>My JSP 'CreateTable.jsp' starting page</title>

		<script type="text/javascript">
		
			function addTR(){
				
				var dtable = document.getElementById("dataTable");
			
				var curtr = document.getElementById("toadd");
				
				var input = document.createElement("input");
				input.setAttribute("name", "field");
				var newtr = document.createElement("div");
				
				newtr.appendChild(input);
				
				dtable.insertBefore(newtr, curtr);
				
				return false;
			}
		</script>

	</head>

	<body>
		当前项目名称：<%=request.getParameter("projectName") %>
		<form name="form1" method="post" action="createSheet.action">
			<input type="hidden" name="projectName" value="<%=request.getParameter("projectName") %>">
			<div id="dataTable">
				<div>
					表名： <input type="text" name="sheetName"/>	
				</div>
				<div>
					添加字段
				</div>
				<div>
						<input type="text" name="field">
				</div>
				<div id="toadd">
					
						<button onclick="addTR(); return false;">添加新字段</button>
					
				</div>
			</div>
			<input type="submit" name="TableSummit" id="TableSummit" value="提交" >
			<input type="reset" value="重置";>
		
		</form>
	</body>
</html>
